package com.example.service.impl.datastatistics.yanglaofuwuchuangweiServiceImp;

import com.example.bean.datastatistics.yanglaofuwuchuangwei.YangLaoFuChuangWeiDuoTiaoJian;
import com.example.bean.datastatistics.yanglaofuwuchuangwei.YangLaoFuWuChuangWei;
import com.example.mapper.datastatistics.DatastatisticsMapper;
import com.example.service.datastatistics.yanglaofuwuchuangwei.YangLaoFuWuChuangWeiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class YangLaoFuWuChuangWeiServiceImp implements YangLaoFuWuChuangWeiService {
    @Autowired
    DatastatisticsMapper datastatisticsMapper;
    @Override
    public List<YangLaoFuWuChuangWei> yanglaofuwuchuangweiList(YangLaoFuChuangWeiDuoTiaoJian yangLaoFuChuangWeiDuoTiaoJian) {
        List<YangLaoFuWuChuangWei> num = datastatisticsMapper.yanglaofuwuchuangweiList(yangLaoFuChuangWeiDuoTiaoJian);

        for (YangLaoFuWuChuangWei yanglaofuwuchuangwei:num) {
            if (yanglaofuwuchuangweiBean(yanglaofuwuchuangwei.getAdministrativeDivision()).getGongbanNum()!=null){
                System.out.println("----------------------------------------------------"+yanglaofuwuchuangwei.getNumChuangshu());
                yanglaofuwuchuangwei.setGongbanNum(yanglaofuwuchuangweiBean(yanglaofuwuchuangwei.getAdministrativeDivision()).getGongbanNum());
                yanglaofuwuchuangwei.setGongbanHulixingchuangwei(yanglaofuwuchuangweiBean(yanglaofuwuchuangwei.getAdministrativeDivision()).getGongbanHulixingchuangwei());
                yanglaofuwuchuangwei.setGongbanPutongxingchuangwei(yanglaofuwuchuangweiBean(yanglaofuwuchuangwei.getAdministrativeDivision()).getGongbanPutongxingchuangwei());

                yanglaofuwuchuangwei.setMinbanNum(yanglaofuwuchuangweiBean(yanglaofuwuchuangwei.getAdministrativeDivision()).getMinbanNum());
                yanglaofuwuchuangwei.setMinbanHulixingchuangwei(yanglaofuwuchuangweiBean(yanglaofuwuchuangwei.getAdministrativeDivision()).getMinbanHulixingchuangwei());
                yanglaofuwuchuangwei.setMinbanPutongxingchuangwei(yanglaofuwuchuangweiBean(yanglaofuwuchuangwei.getAdministrativeDivision()).getMinbanPutongxingchuangwei());
            }

        }

        return num;
    }

    @Override
    public YangLaoFuWuChuangWei yanglaofuwuchuangweiBean(String chuanru) {
        return datastatisticsMapper.yanglaofuwuchuangweiBean(chuanru);
    }
}
